Optimal. Leaf size=99 \[ \frac{c^2 x \left (a+\frac{b}{x}\right )^{3/2}}{a}-\frac{c \sqrt{a+\frac{b}{x}} (4 a d+b c)}{a}+\frac{c (4 a d+b c) \tanh ^{-1}\left (\frac{\sqrt{a+\frac{b}{x}}}{\sqrt{a}}\right )}{\sqrt{a}}-\frac{2 d^2 \left (a+\frac{b}{x}\right )^{3/2}}{3 b} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0666848, antiderivative size = 99, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.286, Rules used = {375, 89, 80, 50, 63, 208} \[ \frac{c^2 x \left (a+\frac{b}{x}\right )^{3/2}}{a}-\frac{c \sqrt{a+\frac{b}{x}} (4 a d+b c)}{a}+\frac{c (4 a d+b c) \tanh ^{-1}\left (\frac{\sqrt{a+\frac{b}{x}}}{\sqrt{a}}\right )}{\sqrt{a}}-\frac{2 d^2 \left (a+\frac{b}{x}\right )^{3/2}}{3 b} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 375
Rule 89
Rule 80
Rule 50
Rule 63
Rule 208
Rubi steps
\begin{align*} \int \sqrt{a+\frac{b}{x}} \left (c+\frac{d}{x}\right )^2 \, dx &=-\operatorname{Subst}\left (\int \frac{\sqrt{a+b x} (c+d x)^2}{x^2} \, dx,x,\frac{1}{x}\right )\\ &=\frac{c^2 \left (a+\frac{b}{x}\right )^{3/2} x}{a}-\frac{\operatorname{Subst}\left (\int \frac{\sqrt{a+b x} \left (\frac{1}{2} c (b c+4 a d)+a d^2 x\right )}{x} \, dx,x,\frac{1}{x}\right )}{a}\\ &=-\frac{2 d^2 \left (a+\frac{b}{x}\right )^{3/2}}{3 b}+\frac{c^2 \left (a+\frac{b}{x}\right )^{3/2} x}{a}-\frac{(c (b c+4 a d)) \operatorname{Subst}\left (\int \frac{\sqrt{a+b x}}{x} \, dx,x,\frac{1}{x}\right )}{2 a}\\ &=-\frac{c (b c+4 a d) \sqrt{a+\frac{b}{x}}}{a}-\frac{2 d^2 \left (a+\frac{b}{x}\right )^{3/2}}{3 b}+\frac{c^2 \left (a+\frac{b}{x}\right )^{3/2} x}{a}-\frac{1}{2} (c (b c+4 a d)) \operatorname{Subst}\left (\int \frac{1}{x \sqrt{a+b x}} \, dx,x,\frac{1}{x}\right )\\ &=-\frac{c (b c+4 a d) \sqrt{a+\frac{b}{x}}}{a}-\frac{2 d^2 \left (a+\frac{b}{x}\right )^{3/2}}{3 b}+\frac{c^2 \left (a+\frac{b}{x}\right )^{3/2} x}{a}-\frac{(c (b c+4 a d)) \operatorname{Subst}\left (\int \frac{1}{-\frac{a}{b}+\frac{x^2}{b}} \, dx,x,\sqrt{a+\frac{b}{x}}\right )}{b}\\ &=-\frac{c (b c+4 a d) \sqrt{a+\frac{b}{x}}}{a}-\frac{2 d^2 \left (a+\frac{b}{x}\right )^{3/2}}{3 b}+\frac{c^2 \left (a+\frac{b}{x}\right )^{3/2} x}{a}+\frac{c (b c+4 a d) \tanh ^{-1}\left (\frac{\sqrt{a+\frac{b}{x}}}{\sqrt{a}}\right )}{\sqrt{a}}\\ \end{align*}
Mathematica [A] time = 0.0882163, size = 84, normalized size = 0.85 \[ \frac{\sqrt{a+\frac{b}{x}} \left (b \left (3 c^2 x^2-12 c d x-2 d^2\right )-2 a d^2 x\right )}{3 b x}+\frac{c (4 a d+b c) \tanh ^{-1}\left (\frac{\sqrt{a+\frac{b}{x}}}{\sqrt{a}}\right )}{\sqrt{a}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.01, size = 191, normalized size = 1.9 \begin{align*} -{\frac{1}{6\,b{x}^{2}}\sqrt{{\frac{ax+b}{x}}} \left ( -24\,\sqrt{a{x}^{2}+bx}{a}^{3/2}{x}^{3}cd-6\,\sqrt{a{x}^{2}+bx}\sqrt{a}{x}^{3}b{c}^{2}-12\,\ln \left ( 1/2\,{\frac{2\,\sqrt{a{x}^{2}+bx}\sqrt{a}+2\,ax+b}{\sqrt{a}}} \right ){x}^{3}abcd-3\,\ln \left ( 1/2\,{\frac{2\,\sqrt{a{x}^{2}+bx}\sqrt{a}+2\,ax+b}{\sqrt{a}}} \right ){x}^{3}{b}^{2}{c}^{2}+24\, \left ( a{x}^{2}+bx \right ) ^{3/2}\sqrt{a}xcd+4\,{d}^{2} \left ( a{x}^{2}+bx \right ) ^{3/2}\sqrt{a} \right ){\frac{1}{\sqrt{ \left ( ax+b \right ) x}}}{\frac{1}{\sqrt{a}}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.33427, size = 462, normalized size = 4.67 \begin{align*} \left [\frac{3 \,{\left (b^{2} c^{2} + 4 \, a b c d\right )} \sqrt{a} x \log \left (2 \, a x + 2 \, \sqrt{a} x \sqrt{\frac{a x + b}{x}} + b\right ) + 2 \,{\left (3 \, a b c^{2} x^{2} - 2 \, a b d^{2} - 2 \,{\left (6 \, a b c d + a^{2} d^{2}\right )} x\right )} \sqrt{\frac{a x + b}{x}}}{6 \, a b x}, -\frac{3 \,{\left (b^{2} c^{2} + 4 \, a b c d\right )} \sqrt{-a} x \arctan \left (\frac{\sqrt{-a} \sqrt{\frac{a x + b}{x}}}{a}\right ) -{\left (3 \, a b c^{2} x^{2} - 2 \, a b d^{2} - 2 \,{\left (6 \, a b c d + a^{2} d^{2}\right )} x\right )} \sqrt{\frac{a x + b}{x}}}{3 \, a b x}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 17.7495, size = 121, normalized size = 1.22 \begin{align*} - \frac{4 a c d \operatorname{atan}{\left (\frac{\sqrt{a + \frac{b}{x}}}{\sqrt{- a}} \right )}}{\sqrt{- a}} + \sqrt{b} c^{2} \sqrt{x} \sqrt{\frac{a x}{b} + 1} - 4 c d \sqrt{a + \frac{b}{x}} + d^{2} \left (\begin{cases} - \frac{\sqrt{a}}{x} & \text{for}\: b = 0 \\- \frac{2 \left (a + \frac{b}{x}\right )^{\frac{3}{2}}}{3 b} & \text{otherwise} \end{cases}\right ) + \frac{b c^{2} \operatorname{asinh}{\left (\frac{\sqrt{a} \sqrt{x}}{\sqrt{b}} \right )}}{\sqrt{a}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: TypeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]